<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>管理员登录 - 百度新闻平台</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <style>
        /* 全局样式 */
        body {
            font-family: 'Microsoft YaHei', sans-serif;
            background-color: #f8f9fa;
            height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        
        /* 登录容器样式 */
        .login-container {
            background-color: #ffffff;
            border-radius: 8px;
            box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
            padding: 40px;
            width: 100%;
            max-width: 400px;
        }
        
        /* 登录标题样式 */
        .login-title {
            text-align: center;
            font-size: 24px;
            font-weight: 600;
            color: #333;
            margin-bottom: 30px;
        }
        
        /* 表单样式 */
        .form-group {
            margin-bottom: 20px;
        }
        
        .form-group label {
            display: block;
            font-weight: 500;
            color: #333;
            margin-bottom: 8px;
        }
        
        .form-control {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            transition: border-color 0.3s ease;
        }
        
        .form-control:focus {
            outline: none;
            border-color: #007bff;
            box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
        }
        
        /* 按钮样式 */
        .btn-login {
            width: 100%;
            padding: 10px;
            background-color: #007bff;
            color: white;
            border: none;
            border-radius: 4px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: background-color 0.3s ease;
        }
        
        .btn-login:hover {
            background-color: #0056b3;
        }
        
        /* 错误提示样式 */
        .error-message {
            background-color: #f8d7da;
            color: #721c24;
            padding: 10px;
            border-radius: 4px;
            margin-bottom: 20px;
            text-align: center;
        }
        
        /* Logo样式 */
        .login-logo {
            text-align: center;
            margin-bottom: 30px;
        }
        
        .login-logo img {
            width: 80px;
            height: 80px;
        }
        
        /* 版权信息样式 */
        .copyright {
            text-align: center;
            margin-top: 20px;
            font-size: 12px;
            color: #999;
        }
    </style>
</head>
<body>
    <div class="login-container">
        <!-- Logo -->
        <div class="login-logo">
            <img src="https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt="百度">
        </div>
        
        <!-- 标题 -->
        <h2 class="login-title">管理员登录</h2>
        
        <!-- 错误提示 -->
        {% if error %}
            <div class="error-message">{{ error }}</div>
        {% endif %}
        
        <!-- 登录表单 -->
         默认用户名/密码：<br>
        <form method="POST" action="/admin/login">
            <div class="form-group">
                <label for="username">用户名</label>
                <input type="text" class="form-control" id="username" name="username" placeholder="请输入用户名" required>
            </div>
            
            <div class="form-group">
                <label for="password">密码</label>
                <input type="password" class="form-control" id="password" name="password" placeholder="请输入密码" required>
            </div>
            
            <button type="submit" class="btn-login">登录</button>
        </form>
        
        <!-- 版权信息 -->
        <div class="copyright">
            &copy; 2023 百度新闻平台 管理员系统
        </div>
    </div>

    <!-- JavaScript -->
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 页面加载完成后执行
        $(document).ready(function() {
            // 为用户名输入框添加焦点效果
            $('#username').focus(function() {
                $(this).parent().find('label').css('color', '#007bff');
            }).blur(function() {
                $(this).parent().find('label').css('color', '#333');
            });
            
            // 为密码输入框添加焦点效果
            $('#password').focus(function() {
                $(this).parent().find('label').css('color', '#007bff');
            }).blur(function() {
                $(this).parent().find('label').css('color', '#333');
            });
        });
    </script>
</body>
</html>